/*
 *  Copyright 2012 SerGenis. All rights reserved.
 */
package com.sergenis.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 *
 * @author SerGenis
 */
public class UtilList {

    public static <T> List<T> removeOn(List<T> source, T obj) {
	T[] aset = (T[]) source.toArray();
	List<T> set = new ArrayList<T>(Arrays.asList(aset));
	set.remove(obj);
	return set;
    }

    public static <T> List<T> addOn(List<T> source, T obj) {
	T[] aset = (T[]) source.toArray();
	List<T> set = new ArrayList<T>(Arrays.asList(aset));
	set.add(obj);
	return set;
    }
}
